package com.wumai.modernguilib.utils;

public class MathHelper {
    public static int sum(int[] arr, int start, int end) {
        int sum = 0;
        for (int i = start; i < end; i++) {
            sum += arr[i];
        }
        return sum;
    }

    public static int sum(int[] arr) {
        return sum(arr, 0, arr.length);
    }

    public static float sum(float[] arr, int start, int end) {
        float sum = 0;
        for (int i = start; i < end; i++) {
            sum += arr[i];
        }
        return sum;
    }

    public static float sum(float[] arr) {
        return sum(arr, 0, arr.length);
    }
}
